package cn.edu.scau.cmi.luochenghao.chapter04;

import java.util.Scanner;

public class ElectricCharge {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		double electricCharge, electricityConsumption;
		System.out.print("请输入用户的用电量：");
		electricCharge = reader.nextDouble();
		if (electricCharge <= 90)
			electricityConsumption = electricCharge * 0.9;
		else if (electricCharge <= 150)
			electricityConsumption = 90 * 0.9 + (electricCharge - 90) * 1.1;
		else
			electricityConsumption = 90 * 0.9 + 60 * 1.1 + (electricCharge - 150) * 1.7;
		System.out.print("该用户的电费是：");
		System.out.println(electricityConsumption);
	}
}
